package demo.controller;

import demo.model.UserInfo;
import demo.service.UserSevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//负责调用Service
@RequestMapping("/user")
@RestController
public class UserController {
    @RequestMapping("test")
    public String test() {
        return "9999";
    }

    @Autowired
    private UserSevice userSevice;

    @RequestMapping("/get")
    public List<UserInfo> getUserInfo() {
        return userSevice.getUserInfo();
    }
}
